package com.zy.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.admin.mapper.TestMapper;
import com.zy.admin.service.TestService;
import com.zy.admin.data.entiy.TestEntiy;
import com.zy.common.core.exception.BizException;
import com.zy.common.core.enums.ErrorEnums;
import com.zy.common.redis.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntiy> implements TestService {
    @Resource
    private RedisUtils redisUtils;

    @Override
    public void test() {
        try {
            redisUtils.set("33333", "123123");
            TestEntiy testEntiy = new TestEntiy();
            testEntiy.setName("123132");
            this.save(testEntiy);

        } catch (Exception e) {
            log.info(e.getMessage());
            throw new BizException(ErrorEnums.SYSTEM_ERROR);
        }

    }

}
